//获取应用实例
const app = getApp();

Page({
    data: {
      //遮罩层的显示 / 影藏
      isMaskShow:false,
      maskInfo:{
        title:"标题",
        bg:""
      },
      //导航的数据
      //写中文,汉字的时候记得加引号
      nav:[
        {title:'首页'},
        {title:'关于'},
        {title:'介绍'},
        {title:'环境'},
        {title:'作品'},
        {title:'就业'},
        {title:'优势'},
        {title:'联系'},
      ],
      // 控制导航的显示 / 隐藏
      navShow:false,
      current:0
    },
  //显示蒙层
  showMask(e){
    var lesson = e.currentTarget.dataset.lesson;
    // console.log(lesson);
    if(lesson === "ui"){
      this.setData({
        maskInfo:{
          title:"UI设计精品班",
          bg:"linear-gradient(-137deg, #FF4A5A 0%, #FFCB8A 100%);"
        }
      }) 
    }else{
      this.setData({
        maskInfo:{
          title:"H5前端开发精品班",
          bg:"linear-gradient(-137deg, #5897FF 0%, #B688FF 100%);"
        }
      }) 
    }
    this.setData({
      isMaskShow:!this.data.isMaskShow
    })
  },
  // 关闭
  close(){
    this.setData({
      isMaskShow:false
    })
  },
  // 返回顶部按钮
  goTop(){
    console.log('111');
      wx.pageScrollTo({
        scrollTop:0,
        duration:2000
      })
  },
  // 弹出导航栏
  ejectNav(){
    // console.log('111');
    this.setData({
      navShow:!this.data.navShow
    })
  },
  // 点击字体改变颜色
  changeColor(event){
    // console.log('11@',event);
    const index = event.target.dataset.index;
    this.setData({
      current:index
    })
  },
  boxEvents(){
    // console.log("@111");
  },
    
})